package com.rupertjones.globalcron.web.service;

import com.rupertjones.globalcron.domain.Host;
import com.rupertjones.globalcron.domain.JobDescriptor;
import com.rupertjones.globalcron.web.model.DisplayableJob;

import java.util.Collection;

/**
 * <p>GlobalCron &copy Rupert Jones 2011,2012</p>
 *
 * @author rup
 */
public interface JobService {
    Collection<DisplayableJob> getEnabledJobs();
    Collection<DisplayableJob> getEnabledJobsForHost();
    Collection<DisplayableJob> getExecutingJobs();
    Collection<DisplayableJob> getDisabledJobs();
    Collection<DisplayableJob> getDisabledJobsForHost();
    Collection<DisplayableJob> getEnabledJobs(Host host);
    Collection<DisplayableJob> getDisabledJobs(Host host);
    Collection<Host> getHosts();
    JobDescriptor getJob(int jobId);
    DisplayableJob getDisplayableJob(int jobId);
    void save(JobDescriptor job);
    void save(Host host);
    void delete(JobDescriptor job);
    boolean hasEnabledJob(int jobId);
    boolean runNow(JobDescriptor job);
    Host getCurrentHost();
    Host getHost(int hostId);
    Collection<DisplayableJob> getAllJobs();
    void stopAll();
    void refreshJobs();
}
